# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=linenum
pkgver=75.c47f9b2
pkgrel=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-recon')
arch=('any')
pkgdesc='Scripted Local Linux Enumeration & Privilege Escalation Checks'
url='https://github.com/rebootuser/LinEnum'
license=('GPL3')
# todo: add tools from script as dependencies
depends=()
makedepends=('git')
source=("$pkgname::git+https://github.com/rebootuser/LinEnum.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG.md \
    CONTRIBUTORS.md

  cp -a *.sh "$pkgdir/usr/share/$pkgname/"

  ln -s "/usr/share/linenum/LinEnum.sh" "$pkgdir/usr/bin/$pkgname"
}

